package com.lzp.copyui.main

import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.base.BaseFragment
import com.lzp.copyui.design.ShapeImageViewActivity
import com.lzp.copyui.R
import com.lzp.copyui.design.ShapeViewActivity
import com.lzp.copyui.gallery.GalleryActivity
import com.lzp.copyui.ijk.GSYVideoPlayer
import com.lzp.copyui.message.MessageActivity
import com.lzp.copyui.mvvmtest.MVVMTestActivity
import com.lzp.copyui.tabmanager.TabManagerActivity
import com.lzp.copyui.transition.CarActivity
import kotlinx.android.synthetic.main.copyui_fragment.*

/**
 * @describe:
 * @Author: lixiaopeng
 * @Date: 2020/3/24
 */
class CopyUiFragment : BaseFragment(), View.OnClickListener {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater.inflate(R.layout.copyui_fragment, null)
    }

    override fun setListener() {
        super.setListener()
        switchMsgOpenTv.setOnClickListener(this)
        transitionTv.setOnClickListener(this)
        tabManagerTv.setOnClickListener(this)
        galleryTv.setOnClickListener(this)
        shapeImageViewTv.setOnClickListener(this)
        shapeViewTv.setOnClickListener(this)
        mvvmTv.setOnClickListener(this)
        ijkPlayer.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.switchMsgOpenTv -> {
                val intent = Intent(activity, MessageActivity::class.java)
                startActivity(intent)
            }
            R.id.transitionTv -> {
                val intent = Intent(activity, CarActivity::class.java)
                startActivity(intent)
            }
            R.id.tabManagerTv -> {
                val intent = Intent(activity, TabManagerActivity::class.java)
                startActivity(intent)
            }
            R.id.galleryTv->{
                val intent = Intent(activity, GalleryActivity::class.java)
                startActivity(intent)
            }
            R.id.shapeImageViewTv->{
                val intent = Intent(activity, ShapeImageViewActivity::class.java)
                startActivity(intent)
            }
            R.id.shapeViewTv->{
                val intent = Intent(activity, ShapeViewActivity::class.java)
                startActivity(intent)
            }

            R.id.mvvmTv->{
                val intent = Intent(activity, MVVMTestActivity::class.java)
                startActivity(intent)
            }
            R.id.ijkPlayer->{
                val intent = Intent(activity, GSYVideoPlayer::class.java)
                startActivity(intent)
            }
        }
    }
}